#ifndef STITLEBAR_H
#define STITLEBAR_H
#include <QWidget>
#include <QLabel>
#include <QPushButton>
#include <QMouseEvent>
#include <QTimer>

class STitleBar : public QWidget
{
    Q_OBJECT
public:
    explicit STitleBar(QWidget *parent = nullptr);

    void SetTitle(QString text);
    void SetDateTime();

private:
    QLabel* title;
    QLabel* datetime;
    QTimer* timer;
    QPushButton* closeButton;

    void setupUI();
    void setupConnections();
    void applyStyles();

protected:
    void mousePressEvent(QMouseEvent* e) override;
    void mouseMoveEvent(QMouseEvent* e) override;
    void mouseReleaseEvent(QMouseEvent* e) override;

private:
    bool m_bDrag = false;
    QPoint m_dragStartPos;

signals:
    void closeWindow();
};

#endif // STITLEBAR_H
